package com.jd.ty.dao;

import java.math.BigDecimal;
import java.util.List;

import org.hibernate.classic.Session;

import com.jd.ty.dao.constant.QueryConstants;
import com.jd.ty.dao.util.HqlCriterions;
import com.jd.ty.pojo.CustomerAppreciationLog;
import com.jd.ty.pojo.CustomerOrder;

public class AppreciationLogDAO extends BaseDAO {

	public AppreciationLogDAO() {
		this.setEntityType(CustomerAppreciationLog.class);
	}


	public void deleteByCompanyId(Long custCompanyId) {
		HqlCriterions hc = new HqlCriterions();
		hc.and(QueryConstants.AppreciactionLog.COMPANY+"." +QueryConstants.CustomerCompany.CUST_COMPANY_ID, custCompanyId, QueryConstants.EQ);
		List<CustomerAppreciationLog> logs=getByQuery(hc.getHqlString());
		for (CustomerAppreciationLog customerAppreciationLog : logs) {
			customerAppreciationLog.setCustomerCompany(null);
		}
		hbmTemplate.deleteAll(logs);
	}

}
